package cc.linker.steplink.crm.merchant.controller.acs;

import cc.linker.steplink.crm.merchant.service.acs.BasicDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @Description: 给联汇管理总平台的基础信息接口
 * @Author: wuyue
 * @Date: 2019/9/20 9:52
 * @Version: v1.9.1
 */
@RestController
@RequestMapping("/basic")
public class BasicDataController {
    @Autowired
    private BasicDataService basicDataService;

    /**
     * 分类类别
     */
    @GetMapping("/classify")
    public List<Map<String, Object>> getClassify() {
        return basicDataService.getClassify();
    }

    /**
     * 行业通用代码
     *
     * @param key
     */
    @GetMapping("/currency")
    public List<Map<String, Object>> getCurrency(String key) {
        return basicDataService.getCurrency(key);
    }

    /**
     * 行业代码
     */
    @GetMapping("/industry")
    public List<Map<String, Object>> getIndustry(String key) {
        return basicDataService.getIndustry(key);
    }

    /**
     * 省
     */
    @GetMapping("/province")
    public List<Map<String, Object>> getProvince() {
        return basicDataService.getProvince();
    }

    /**
     * 市
     */
    @GetMapping("/city")
    public List<Map<String, Object>> getCity(String key) {
        return basicDataService.getCity(key);
    }

    /**
     * 区
     */
    @GetMapping("/region")
    public List<Map<String, Object>> getRegion(String key) {
        return basicDataService.getRegion(key);
    }

    /**
     * 银行网点
     */
    @GetMapping("/paybank")
    public List<Map<String, Object>> getPayBank(String key, String bankId) {
        return basicDataService.getPayBank(key, bankId);
    }

    /**
     * 银行列表
     */
    @GetMapping("/bank")
    public List<Map<String, Object>> getBank(String key) {
        return basicDataService.getBank(key);
    }


    /**
     * 通用类目
     */
    @GetMapping("/commoncategory")
    public Map<String, Object> getCommonCategory(@RequestParam(value = "id", defaultValue = "0", required = false) int id) {
        return basicDataService.getCommonCategory(id);
    }
    /**
     * 通用类目不获取是否有商品
     */
    @GetMapping("/commoncategorys")
    public Map<String, Object> getCommonCategorys(@RequestParam(value = "id", defaultValue = "0", required = false) int id) {
        return basicDataService.getCommonCategorys(id);
    }
}